package com.gopay.common.domain.cust;

import com.gopay.common.domain.BaseEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * 数字证书购买记录表
 * Created by zhaojt on 2016/9/5.
 */
@Entity
@Table(name = "CUST_CA_BUY_DTL")
public class CustCaBuyDtl extends BaseEntity{

    public static String DTL_TYPE_PRESENT = "01"; //赠送

    public static String DTL_TYPE_BUY = "02";     //购买

    public static String AUDIT_PENDING = "01";    //待审核

    public static String AUDIT_PASS = "02";       //通过

    public static String AUDIT_REJECT = "03";     //拒绝

    public static String AUDIT_WITHOUT = null ;   //portal首次开启赠送，不需要审核

    @Id
    @SequenceGenerator(name = "CUST_CA_BUY_DTL_SEQ_GENERATOR", sequenceName = "CUST_CA_BUY_DTL_SEQ", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CUST_CA_BUY_DTL_SEQ_GENERATOR")
    @Column(name = "ID")
    private Long id;

    @Column(name = "CUST_ID")
    private String custId;

    @Column(name = "GOPAY_ORDER_ID")
    private String gopayOrderId;

    @Column(name = "COUNT")
    private Integer count;

    @Column(name = "USED_COUNT")
    private Integer usedCount;

    @Column(name = "UNUSED_COUNT")
    private Integer unusedCount;

    @Column(name = "TRANS_TS")
    private Date transTs;

    @Column(name = "DTL_TYPE")
    private String dtlType;                 //记录类型 01-赠送 02-购买

    @Column(name = "DRAWBACK_CA_COUNT")
    private Integer drawbackCaCount;        //退款证书数量

    @Column(name = "INSTALL_EXPIRE_TS")
    private Date installExpireTs;           //安装截止日期

    @Column(name = "AUDIT_STAT")
    private String auditStatus;           //审批状态 01-待审核 02-通过 03-拒绝

    @Column(name = "CREATE_TS")
    private Date createDate;

    @Column(name = "AUDIT_TS")
    private Date auditDate;

    @Column(name = "CREATE_OPER_ID")
    private String createOper;

    @Column(name = "AUDIT_OPER_ID")
    private String auditOper;

    @Column(name = "AUDIT_REASON")
    private String auditReason;

    @Version
    @Column(name = "VERSION")
    private long version = 0;

    @Column(name = "EXPIRED_DAY")
    private Integer expireDay;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getGopayOrderId() {
        return gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getUsedCount() {
        return usedCount;
    }

    public void setUsedCount(Integer usedCount) {
        this.usedCount = usedCount;
    }

    public Integer getUnusedCount() {
        return unusedCount;
    }

    public void setUnusedCount(Integer unusedCount) {
        this.unusedCount = unusedCount;
    }

    public Date getTransTs() {
        return transTs;
    }

    public void setTransTs(Date transTs) {
        this.transTs = transTs;
    }

    public String getCustId() {
        return custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    public String getDtlType() {
        return dtlType;
    }

    public void setDtlType(String dtlType) {
        this.dtlType = dtlType;
    }

    public Integer getDrawbackCaCount() {
        return drawbackCaCount;
    }

    public void setDrawbackCaCount(Integer drawbackCaCount) {
        this.drawbackCaCount = drawbackCaCount;
    }

    public Date getInstallExpireTs() {
        return installExpireTs;
    }

    public void setInstallExpireTs(Date installExpireTs) {
        this.installExpireTs = installExpireTs;
    }

    public String getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(String auditStatus) {
        this.auditStatus = auditStatus;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getAuditDate() {
        return auditDate;
    }

    public void setAuditDate(Date auditDate) {
        this.auditDate = auditDate;
    }

    public String getCreateOper() {
        return createOper;
    }

    public void setCreateOper(String createOper) {
        this.createOper = createOper;
    }

    public String getAuditOper() {
        return auditOper;
    }

    public void setAuditOper(String auditOper) {
        this.auditOper = auditOper;
    }

    public String getAuditReason() {
        return auditReason;
    }

    public void setAuditReason(String auditReason) {
        this.auditReason = auditReason;
    }

    public long getVersion() {
        return version;
    }

    public void setVersion(long version) {
        this.version = version;
    }

    public Integer getExpireDay() {
        return expireDay;
    }

    public void setExpireDay(Integer expireDay) {
        this.expireDay = expireDay;
    }
}
